#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/12/28 16:40
# @Author  : Andrewq
# @Site    : nope
# @File    : UserStudyHistoriesModel.py
# @Software: PyCharm
import datetime

from flask import g, current_app
from sqlalchemy import or_, INTEGER, String, DateTime, text

from . import db
from ..utils import commons
from ..utils.response_code import RET


class UserStudyHistory(db.Model):
    __tablename__ = 'user_study_histories'

    AutoID = db.Column(db.INTEGER, primary_key=True)
    userID = db.Column(db.String(100), nullable=False)
    codeID = db.Column(db.String(255), nullable=False)
    webID = db.Column(db.String(255), nullable=False)
    infomationID = db.Column(db.String(255), nullable=False)
    preStudyName = db.Column(db.String(255), nullable=False)
    preStudyUrl = db.Column(db.String(255), nullable=False)
    createTime = db.Column(db.DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))